iterate over tensor using while loop tensorflow tutorial